import request from '@/utils/request'
import { get, post } from '@/utils/requestMethod'

// 上传图片
const uploadFile = function(data) {
  return request({
    method: 'post',
    url: 'http://122.114.33.40:9000/taskindent/upload',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data
  })
}

// 获取资讯类别
const getArticlecategory = function(data) {
  return get('/articlecategory/loadAll', data)
}

// 添加资讯
const addInformation = function(data) {
  return post('/article/saveT', data)
}
// const addInformation = function(data) {
//   return request({
//     method: 'post',
//     url: '/article/saveT',
//     headers: {
//       'Content-Type': 'multipart/form-data',
//     },
//     data
//   })
// }



const getInformation = function (data) {
  return get('/article/loadObjectByPramas',data)
}

const upTInformation = function (data) {
  return get('/article/updT',data)
}

export {
  uploadFile,
  getArticlecategory,
  addInformation,
  getInformation,
  upTInformation
}
